<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--suppress ALL-->
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<base th:href="@{/}"><!-- 不用base就使用th:src="@{/js/jquery.min.js} -->
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>天天生鲜-购物车</title>
	<link rel="stylesheet" type="text/css" href="css/reset.css">
	<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
<div class="header_con">
	<div class="header">
		<div class="welcome fl">欢迎来到天天生鲜!</div>
		<div class="fr">
			<div class="login_info fl">
				欢迎您：<em>张 山</em>
			</div>
			<div class="login_btn fl">
				<a href="/index">首页</a>
				<a href="/toLogin" th:if="${session.user==null}">登录</a>
				<span th:if="${session.user!=null}" th:text="'欢迎：'+${session.user.userEmail}" style="color: black"></span>
				<span>|</span>
				<a href="/toRegister">注册</a>
			</div>
			<div class="user_link fl">
				<span>|</span>
				<a href="/toUserCenterInfo">用户中心</a>
				<span>|</span>
				<a href="/carttable/myCart">我的购物车</a>
				<span>|</span>
				<a href="/focustable/myFocus">我的收藏</a>
				<span>|</span>
				<a href="/toUserCenterOrder?currentPage=1&pageSize=4">我的订单</a>
			</div>
		</div>
	</div>
</div>

<div class="search_bar clearfix">
	<a href="index.html" class="logo fl"><img src="images/logo.png"></a>
	<div class="sub_page_name fl">|&nbsp;&nbsp;&nbsp;&nbsp;我的收藏</div>
	<div class="search_con fr">
		<input type="text" class="input_text fl" name="" placeholder="搜索商品">
		<input type="button" class="input_btn fr" name="" value="搜索">
	</div>
</div>

<div class="total_count">全部收藏</div>
<div align="center">

	<ul class="cart_list_th clearfix" >
		<li class="col01" style="width:26%">商品图片</li>
		<li class="col02" style="width:20%">商品名称</li>
		<li class="col03" style="width: 27%">商品价格</li>
		<!--	<li class="col04">数量</li>-->
		<!--	<li class="col05">小计</li>-->
		<li class="col04" style="width: 19%">操作</li>
	</ul>
</div>

<div th:each="focus:${focustables}" align="center">
	<ul class="cart_list_td clearfix"  th:each="goodsList:${goodstableList}" th:if="${goodsList.id}==${focus.goodId}">
		<!--	<li class="col01"><input type="checkbox" name="" checked></li>-->
		<li class="col02" style="width:27%"><img th:src="'images/'+ ${goodsList.picture}"></li>
		<li class="col03" style="margin-left: 7%" th:text="${goodsList.name}"></li>
		<!--	<li class="col04">500g</li>-->
		<li class="col04" style="width: 20%;margin-left: 5%" th:text="${goodsList.newPrice}"></li>
		<li class="col05" style="width: 27%"><a th:href="@{/focustable/deleteFocus(focusId=${focus.id})}">删除</a>&nbsp;&nbsp;<a th:href="'javascript:cart('+ ${goodsList.id} +')'" >加入购物车</a></li>
	</ul>
</div>





<ul class="settlements">
<!--	<li class="col01"><input type="checkbox" name="" checked=""></li>-->
<!--	<li class="col02">全选</li>-->
<!--	<li class="col03">合计(不含运费)：<span>¥</span><em>42.60</em><br>共计<b>2</b>件商品</li>-->
	<li class="col04"><a href="place_order.html">加入购物车</a></li>
</ul>

<div class="footer">
	<div class="foot_link">
		<a href="#">关于我们</a>
		<span>|</span>
		<a href="#">联系我们</a>
		<span>|</span>
		<a href="#">招聘人才</a>
		<span>|</span>
		<a href="#">友情链接</a>
	</div>
	<p>CopyRight © 2016 北京天天生鲜信息技术有限公司 All Rights Reserved</p>
	<p>电话：010-****888    京ICP备*******8号</p>
</div>

</body>
<script src="/js/jquery-1.12.4.min.js">

</script>
<script>
	//加入购物车
	function cart(goodId){
	var num = $("#num").val();
	//发起ajax请求
	$.get("/carttable/cartInfo",{"goodId":goodId,"num":1},function (data){
	if(data.code==200){
	alert(data.message);
	}else{
	alert(data.message);
	}
	},"json");
	}
</script>
</html>